package com.qf.pojo;

import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

/**
 * @author bss
 * @version V1.0
 * @Project maven
 * @Package com.qf.pojo
 * @Description:
 * @Date 2022/9/29 10:54
 */

@Component("id")
//@Scope("prototype")  原型模式
//@ComponentScan 替代spring.xml中的注解扫描
public class User {

    @PostConstruct
    public void init(){
        System.out.println("初始化");
    }

    @PreDestroy
    public void destory(){
        System.out.println("销毁");
    }
}
